From: kfraser@localhost.localdomain Date: Wed, 14 Feb 2007 12:10:01 +0000 (+0000) Subject: Support INC/DEC in mmio decoder. Opcodes 0xFE and 0xFF. X-Git-Tag: archive/raspbian/4.8.0-1+rpi1~1^2~15327^2^2~7 X-Git-Url: https://dgit.raspbian.org/%22http:/www.example.com/cgi/%22https:/%22bookmarks://%22Dat/%22http:/www.example.com/cgi/%22https:/%22bookmarks:/%22Dat?a=commitdiff_plain;h=e036449798d2de2b6752f492ff8c0c377e08be9e;p=xen.git Support INC/DEC in mmio decoder. Opcodes 0xFE and 0xFF. Signed-off-by: Keir Fraser --- diff --git a/xen/arch/x86/hvm/platform.c b/xen/arch/x86/hvm/platform.c index 404c9b62fc..76202a36c0 100644 --- a/xen/arch/x86/hvm/platform.c +++ b/xen/arch/x86/hvm/platform.c @@ -690,6 +690,39 @@ static int mmio_decode(int address_bytes, unsigned char *opcode, } else return DECODE_failure; + case 0xFE: + case 0xFF: + { + unsigned char ins_subtype = (opcode[1] >> 3) & 7; + + if ( opcode[0] == 0xFE ) { + *op_size = BYTE; + GET_OP_SIZE_FOR_BYTE(size_reg); + } else { + GET_OP_SIZE_FOR_NONEBYTE(*op_size); + size_reg = *op_size; + } + + mmio_op->immediate = 1; + mmio_op->operand[0] = mk_operand(size_reg, 0, 0, IMMEDIATE); + mmio_op->operand[1] = mk_operand(size_reg, 0, 0, MEMORY); + + switch ( ins_subtype ) { + case 0: /* inc */ + mmio_op->instr = INSTR_ADD; + return DECODE_success; + + case 1: /* dec */ + mmio_op->instr = INSTR_OR; + return DECODE_success; + + default: + printk("%x/%x, This opcode isn't handled yet!\n", + *opcode, ins_subtype); + return DECODE_failure; + } + } + case 0x0F: break;